/*
 +----------------------------------------------------------------------
 + Title        : 订单 pinia 存储
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2023-08-12
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 订单 pinia 存储
 +----------------------------------------------------------------------
*/

import { defineStore } from "pinia";
import { ref } from "vue";

export const useOrderStore = defineStore('order', () => {
    
    // 创建订单参数
    const createOrderParams = ref()

    // 设置创建订单信息
    const setCreateOrderParams = (data:any) => {
        createOrderParams.value = data
    }

    // 清除创建订单信息
    const clearCreateOrderParams = () => {
        createOrderParams.value = undefined
    }

    return {
        createOrderParams,
        setCreateOrderParams,
        clearCreateOrderParams
    }
},
// 持久化
{
    persist: true
})

